<template>
    <div>
      <img src="../assets/logo_colorful.png" class="logo-img" @click="doShowHome" alt="">
      <div class="action-container">
        <div class="action-item" :class="{'page-selected': ('Home' === tmpPageName)}">
          <i class="el-icon-discover" style="font-size: 26px" @click="doShowHome"></i>
        </div>
        <div class="action-item" :class="{'page-selected': ('Mine' === tmpPageName)}">
          <i class="el-icon-user" style="font-size: 26px" @click="doShowUserInfo"></i>
        </div>
        <div class="action-item" :class="{'page-selected': ('TopDownload' === tmpPageName)}">
          <i class="el-icon-star-off" style="font-size: 26px" @click="doShowTopDownload"></i>
        </div>
        <div class="action-item" style="margin-bottom: 16px" :class="{'page-selected': ('About' === tmpPageName)}">
          <i class="el-icon-warning-outline" style="font-size: 26px;transform:rotate(180deg)" @click="doShowAbout"></i>
        </div>
        <div class="action-item"
             style="margin-bottom: 16px"
             :class="{'page-selected': ('Apps' === tmpPageName)}">
          <i class="el-icon-download" style="font-size: 26px" @click="doShowApps"></i>
        </div>
      </div>
    </div>
</template>

<script>
export default {
  name: 'AppLeftBar',
  data () {
    return {}
  },
  computed: {
    tmpPageName: function () {
      return this.$store.state.currentPage + ''
    }
  },
  created () {
  },
  mounted () {
  },
  methods: {
    doShowHome () {
      this.$router.push({name: 'Home'})
    },
    doShowUserInfo () {
      if (this.$store.getters.isLogined === false) {
        this.$router.push({name: 'Login'})
        return
      }
      this.$router.push({name: 'Mine'})
    },
    doShowTopDownload () {
      this.$router.push({name: 'TopDownload'})
    },
    doShowApps () {
      this.$router.push({name: 'Apps'})
    },
    doShowAbout () {
      this.$router.push({name: 'About'})
    }
  }
}
</script>

<style scoped>
  .logo-img {
    width: 18px;
    margin-top: 16px;
    display: inline-block;
    background-color: rgba(255,255,255, 0.4);
    padding: 4px;
    border: 0px solid rgba(255,255,255, 0.1);
    border-radius: 2px;
  }
  .logo-img:hover {
    /*transform: rotate(270deg) scale(1.5, 1.5);*/
    /*transition: 0.3s;*/
  }
  .action-container {
    position: absolute;
    left: 0px;
    right: 0px;
    bottom: 0px;
    color: white;
    /*background-color: #999999;*/
    /*border-top: 1px solid #E4E4E4;*/
  }
  .action-item {
    height: 60px;
    line-height: 60px;
    font-size: 24px;
  }
  .action-item:hover {
    color: green;
    transform: scale(1.2, 1.2);
    transition: 0.5s;
  }
  .page-selected {
    color: green;
    /*transform: scale(1.4, 1.4);*/
  }
</style>
